﻿using CodeCrawler.UI.Tools.DreadCalculator;

namespace CodeCrawler.UI.Tools.Dread_Calculator
{
    class DreadCalculatorCore : IDread
    {
        public int DamagePotential { get; set; }
        public int Reproducibility { get; set; }
        public int Exploitability { get; set; }
        public int AffectedUsers { get; set; }
        public int Discoverability { get; set; }

        /// <summary>
        /// Constructor
        /// </summary>
        public DreadCalculatorCore() {

            DamagePotential = 0;
            Reproducibility = 0;
            Exploitability = 0;
            AffectedUsers = 0;
            Discoverability = 0;
        }

        /// <summary>
        /// Do Dread Calculation based on field values
        /// </summary>
        /// <returns></returns>
        public string DoCalculation() {

            int total = ((DamagePotential + Reproducibility + Exploitability + AffectedUsers + Discoverability)/5);
            return string.Concat(total, "/10");
        }
    }
}